home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / dev / gcc / gcc270_src.lha / gcc-2.7.0-amiga / config / m88k / dgux.h next >
C/C++ Source or Header  |  1995-06-15  |  10KB  |  275 lines

  1. /* Definitions of target machine for GNU compiler.
  2.    Motorola m88100 running DG/UX.
  3.    Copyright (C) 1988, 92, 93, 94, 1995 Free Software Foundation, Inc.
  4.    Contributed by Michael Tiemann (tiemann@mcc.com)
  5.    Currently maintained by (gcc@dg-rtp.dg.com)
  6.  
  7. This file is part of GNU CC.
  8.  
  9. GNU CC is free software; you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation; either version 2, or (at your option)
  12. any later version.
  13.  
  14. GNU CC is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with GNU CC; see the file COPYING.  If not, write to
  21. the Free Software Foundation, 59 Temple Place - Suite 330,
  22. Boston, MA 02111-1307, USA.  */
  23.  
  24. /* You're not seeing double!  To transition to dwarf debugging, both are
  25.    supported.  The option -msvr4 specifies elf.  With these combinations, 
  26.    -g means dwarf.  */
  27. /* DWARF_DEBUGGING_INFO defined in svr4.h.  */
  28. #define SDB_DEBUGGING_INFO
  29. #define PREFERRED_DEBUGGING_TYPE \
  30.   (TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG)
  31.  
  32. #ifndef VERSION_INFO2
  33. #define VERSION_INFO2   "$Revision: 1.18 $"
  34. #endif
  35. #ifndef NO_BUGS
  36. #define AS_BUG_IMMEDIATE_LABEL
  37. /* The DG/UX 4.30 assembler doesn't accept the symbol `fcr63'.  */
  38. #define AS_BUG_FLDCR
  39. #endif
  40.  
  41. #include "svr4.h"
  42. #include "m88k/m88k.h"
  43.  
  44. /* Augment TARGET_SWITCHES with the MXDB options.  */
  45. #define MASK_STANDARD        0x40000000 /* Retain standard information */
  46. #define MASK_LEGEND        0x20000000 /* Retain legend information */
  47. #define MASK_EXTERNAL_LEGEND    0x10000000 /* Make external legends */
  48.  
  49. #define TARGET_STANDARD          (target_flags & MASK_STANDARD)
  50. #define TARGET_LEGEND          (target_flags & MASK_LEGEND)
  51. #define TARGET_EXTERNAL_LEGEND      (target_flags & MASK_EXTERNAL_LEGEND)
  52.  
  53. #undef  SUBTARGET_SWITCHES
  54. #define SUBTARGET_SWITCHES \
  55.     { "standard",             MASK_STANDARD }, \
  56.     { "legend",                 MASK_LEGEND }, \
  57.     { "external-legend",         MASK_EXTERNAL_LEGEND }, \
  58.     /* the following is used only in the *_SPEC's */ \
  59.     { "keep-coff",             0 },
  60.  
  61. /* Default switches */
  62. #undef    TARGET_DEFAULT
  63. #define TARGET_DEFAULT    (MASK_CHECK_ZERO_DIV     | \
  64.              MASK_OCS_DEBUG_INFO     | \
  65.              MASK_OCS_FRAME_POSITION | \
  66.              MASK_STANDARD         | \
  67.              MASK_SVR4)
  68. #undef    CPU_DEFAULT
  69. #define CPU_DEFAULT MASK_88000
  70.  
  71. /* Macros to be automatically defined.  __svr4__ is our extension.
  72.    __CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header
  73.    files with DG/UX revision 5.40 and later.  This allows GNU CC to
  74.    operate without installing the header files.  */
  75.  
  76. #undef    CPP_PREDEFINES
  77. #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
  78.    -D__svr4__ -Asystem(unix) -Acpu(m88k) -Amachine(m88k)"
  79.  
  80. /* If -m88100 is in effect, add -Dm88100; similarly for -m88110.
  81.    Here, the CPU_DEFAULT is assumed to be -m88000.  If not -ansi,
  82.    -traditional, or restricting include files to one specific source
  83.    target, specify full DG/UX features.  */
  84. #undef    CPP_SPEC
  85. #define    CPP_SPEC "%{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \
  86.           %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \
  87.           %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}} \
  88.           %{msvr3:-D_M88KBCS_TARGET} %{!msvr3:-D_DGUX_TARGET}"
  89.  
  90. /* Assembler support (-V, silicon filter, legends for mxdb).  */
  91. #undef    ASM_SPEC
  92. #define ASM_SPEC "\
  93. %{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\
  94. %{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\
  95. %{!mlegend:%{mstandard:-Wc,off}}\
  96. %{mlegend:-Wc,-fix-bb,-h\"gcc-" VERSION_INFO2 "\",-s\"%i\"\
  97. %{traditional:,-lc}%{!traditional:,-lansi-c}\
  98. %{mstandard:,-keep-std}\
  99. %{mkeep-coff:,-keep-coff}\
  100. %{mexternal-legend:,-external}\
  101. %{mocs-frame-position:,-ocs}}"
  102.  
  103. /* Override svr4.h.  */
  104. #undef    ASM_FINAL_SPEC
  105. #undef    STARTFILE_SPEC
  106.  
  107. /* Linker and library spec's.
  108.    -msvr4 is the default if -msvr3 is not specified.
  109.    -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options.
  110.    -svr4 instructs gcc to place /usr/lib/values-X[cat].o on the link line.
  111.    -msvr3 indicates linking done in a COFF environment and the link
  112.    script is added to the link line.  In all environments, the first
  113.    and last objects are crtbegin.o (or bcscrtbegin.o) and crtend.o.
  114.    When the -G link option is used (-shared and -symbolic) a final
  115.    link is not being done.  */
  116. #undef  ENDFILE_SPEC
  117. #define ENDFILE_SPEC "crtend.o%s"
  118. #undef    LIB_SPEC
  119. #define LIB_SPEC "%{!msvr3:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}}"
  120. #undef    LINK_SPEC
  121. #define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \
  122.            %{static:-dn -Bstatic} \
  123.            %{shared:-G -dy -z text} \
  124.            %{symbolic:-Bsymbolic -G -dy -z text} \
  125.            %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
  126. #undef    STARTFILE_SPEC
  127. #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \
  128.              %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \
  129.              %{msvr3:m88kdgux.ld%s bcscrtbegin.o%s} \
  130.              %{!msvr3:crtbegin.o%s} \
  131.              %{svr4:%{ansi:/lib/values-Xc.o} \
  132.               %{!ansi:%{traditional:/lib/values-Xt.o} \
  133.                %{!traditional:/usr/lib/values-Xa.o}}}}}"
  134.  
  135. #undef    GPLUSPLUS_INCLUDE_DIR
  136. #define GPLUSPLUS_INCLUDE_DIR "/usr/opt/g++/lib/g++-include"
  137.  
  138. /* Fast DG/UX version of profiler that does not require lots of
  139.    registers to be stored.  */
  140. #undef    FUNCTION_PROFILER
  141. #define FUNCTION_PROFILER(FILE, LABELNO) \
  142.   output_function_profiler (FILE, LABELNO, "gcc.mcount", 0)
  143.  
  144. /* Output the legend info for mxdb when debugging except if standard
  145.    debugging information only is explicitly requested.  */
  146. #undef  ASM_FIRST_LINE
  147. #define ASM_FIRST_LINE(FILE)                        \
  148.   do {                                    \
  149.     if (TARGET_SVR4)                            \
  150.       {                                    \
  151.     if (TARGET_88110)                        \
  152.       fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "04.00");   \
  153.     else                                \
  154.       fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00");   \
  155.       }                                    \
  156.     if (write_symbols != NO_DEBUG                    \
  157.     && ! (TARGET_STANDARD && ! TARGET_LEGEND))            \
  158.       {                                    \
  159.     fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"",    \
  160.          VERSION_STRING, main_input_filename);            \
  161.     fputs (flag_traditional ? " -lc" : " -lansi-c", FILE);        \
  162.     if (TARGET_STANDARD)                        \
  163.       fputs (" -keep-std", FILE);                    \
  164.     if (TARGET_EXTERNAL_LEGEND)                    \
  165.       fputs (" -external", FILE);                    \
  166.     if (TARGET_OCS_FRAME_POSITION)                    \
  167.       fputs (" -ocs", FILE);                    \
  168.     fputc ('\n', FILE);                        \
  169.       }                                    \
  170.   } while (0)
  171.  
  172. /* Override svr4.h.  */
  173. #undef PTRDIFF_TYPE
  174. #undef WCHAR_TYPE
  175. #undef WCHAR_TYPE_SIZE
  176.  
  177. /* Override svr4.h and m88k.h except when compiling crtstuff.c.  These must
  178.    be constant strings when compiling crtstuff.c.  Otherwise, respect the
  179.    -mversion-STRING option used.  */
  180. #undef INIT_SECTION_PREAMBLE
  181. #undef INIT_SECTION_ASM_OP
  182. #undef FINI_SECTION_ASM_OP
  183. #undef CTORS_SECTION_ASM_OP
  184. #undef DTORS_SECTION_ASM_OP
  185.  
  186. #if defined (CRT_BEGIN) || defined (CRT_END) || defined (L__main)
  187. /* routines to invoke global constructors and destructors are always COFF 
  188.    to enable linking mixed COFF and ELF objects */
  189. #define FINI_SECTION_ASM_OP ("section  .fini,\"x\"")
  190. #ifndef BCS
  191. #define INIT_SECTION_PREAMBLE asm ("\taddu\tr31,r31,0x20")
  192. #endif
  193. #undef    INIT_SECTION_ASM_OP
  194. #define INIT_SECTION_ASM_OP ("section\t .init,\"x\"")
  195. #undef    CTORS_SECTION_ASM_OP
  196. #define CTORS_SECTION_ASM_OP ("section\t .ctors,\"d\"")
  197. #undef    DTORS_SECTION_ASM_OP
  198. #define DTORS_SECTION_ASM_OP ("section\t .dtors,\"d\"")
  199. #undef OBJECT_FORMAT_ELF
  200. #else
  201. #undef        INIT_SECTION_ASM_OP
  202. #define INIT_SECTION_ASM_OP (TARGET_SVR4                      \
  203.                            ? "section\t .init,\"xa\""         \
  204.                            : "section\t .init,\"x\"")
  205. #undef        CTORS_SECTION_ASM_OP
  206. #define CTORS_SECTION_ASM_OP (TARGET_SVR4                     \
  207.                             ? "section\t .ctors,\"aw\""       \
  208.                             : "section\t .ctors,\"d\"")
  209. #undef        DTORS_SECTION_ASM_OP
  210. #define DTORS_SECTION_ASM_OP (TARGET_SVR4                     \
  211.                             ? "section\t .dtors,\"aw\""       \
  212.                             : "section\t .dtors,\"d\"")
  213. #endif /* crtstuff.c */
  214.  
  215. /* The lists of global object constructors and global destructors are always
  216.    placed in the .ctors/.dtors sections.  This requires the use of a link
  217.    script if the COFF linker is used, but otherwise COFF and ELF objects
  218.    can be intermixed.  A COFF object will pad the section to 16 bytes with
  219.    zeros; and ELF object will not contain padding.  We deal with this by
  220.    putting a -1 marker at the begin and end of the list and ignoring zero
  221.    entries.  */
  222.  
  223. /* Mark the end of the .ctors/.dtors sections with a -1.  */
  224.  
  225. #define CTOR_LIST_BEGIN            \
  226. asm (CTORS_SECTION_ASM_OP);        \
  227. func_ptr __CTOR_LIST__[1] = { (func_ptr) (-1) }
  228.  
  229. #define CTOR_LIST_END            \
  230. asm (CTORS_SECTION_ASM_OP);        \
  231. func_ptr __CTOR_END__[1] = { (func_ptr) (-1) }
  232.  
  233. #define DTOR_LIST_BEGIN            \
  234. asm (DTORS_SECTION_ASM_OP);        \
  235. func_ptr __DTOR_LIST__[1] = { (func_ptr) (-1) }
  236.  
  237. #define DTOR_LIST_END            \
  238. asm (DTORS_SECTION_ASM_OP);        \
  239. func_ptr __DTOR_END__[1] = { (func_ptr) (-1) }
  240.  
  241. /* Walk the list ignoring NULL entries till we hit the terminating -1.  */
  242. #define DO_GLOBAL_CTORS_BODY                \
  243.   do {                            \
  244.     int i;                        \
  245.     for (i=1;(int)(__CTOR_LIST__[i]) != -1; i++)    \
  246.       if (((int *)__CTOR_LIST__)[i] != 0)        \
  247.     __CTOR_LIST__[i] ();                \
  248.   } while (0)                    
  249.  
  250. /* Walk the list looking for the terminating -1 that marks the end.
  251.    Go backward and ignore any NULL entries.  */
  252. #define DO_GLOBAL_DTORS_BODY                \
  253.   do {                            \
  254.     int i;                        \
  255.     for (i=1;(int)(__DTOR_LIST__[i]) != -1; i++);    \
  256.     for (i-=1;(int)(__DTOR_LIST__[i]) != -1; i--)    \
  257.       if (((int *)__DTOR_LIST__)[i] != 0)        \
  258.     __DTOR_LIST__[i] ();                \
  259.   } while (0)                    
  260.  
  261. /* The maximum alignment which the object file format can support.
  262.    page alignment would seem to be enough */
  263. #undef MAX_OFILE_ALIGNMENT
  264. #define MAX_OFILE_ALIGNMENT 0x1000
  265.  
  266. /* Must use data section for relocatable constants when pic.  */
  267. #undef SELECT_RTX_SECTION
  268. #define SELECT_RTX_SECTION(MODE,RTX)            \
  269. {                                               \
  270.   if (flag_pic && symbolic_operand (RTX))       \
  271.     data_section ();                            \
  272.   else                                          \
  273.     const_section ();                           \
  274. }
  275.